package com.jhgsys.internal.system.entity;

import com.jhgsys.internal.common.converter.TimeConverter;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * @author MrBird
 */
@Data
@TableName("BASIC_MENU")
@Excel("菜单信息表")
public class Menu implements Serializable {

    private static final long serialVersionUID = 8571011372410167901L;

    // 菜单
    public static final String TYPE_MENU = "0";
    // 按钮
    public static final String TYPE_BUTTON = "1";

    public static final Long TOP_NODE = 0L;

    /**
     * 菜单/按钮ID
     */
    @TableId(value = "MENU_ID", type = IdType.ASSIGN_UUID)
    private String menuId;

    /**
     * 上级菜单ID
     */
    @TableField("PARENT_ID")
    private String parentId;

    /**
     * 菜单/按钮名称
     */
    @TableField("MENU_NAME")
    @Size(max = 10, message = "{noMoreThan}")
    @ExcelField(value = "名称")
    private String menuName;

    /**
     * 菜单URL
     */
    @TableField("URL")
    @Size(max = 50, message = "{noMoreThan}")
    @ExcelField(value = "URL")
    private String url;

    /**
     * 权限标识
     */
    @TableField("PERMS")
    @Size(max = 50, message = "{noMoreThan}")
    @ExcelField(value = "权限")
    private String perms;

    /**
     * 图标
     */
    @TableField("ICON")
    @Size(max = 50, message = "{noMoreThan}")
    @ExcelField(value = "图标")
    private String icon;

    /**
     * 类型 0菜单 1按钮 2数据
     */
    @TableField("TYPE")
    @ExcelField(value = "类型", writeConverterExp = "0=菜单,1=按钮,2=数据")
    private String type;


    /**
     * 是否分配子公司 0=否 1=是
     */
    @TableField("GRANTED_SUBSIDIARY_FLG")
    @ExcelField(value = "是否分配子公司", writeConverterExp = "0=否 1=是")
    private String grantedSubsidiaryFlg;


    /**
     * 排序
     */
    @TableField("ORDER_NUM")
    private Long orderNum;

    /**
     * 状态 0：禁用 1：启用
     */
    @TableField("STATUS")
    private String status;

    /**
     * 创建人id
     */
    @TableField("CREATED_BY")
    @ExcelField("创建人id")
    private String createdBy;
    /**
     * 创建时间
     */
    @TableField("CREATED_TIME")
    @ExcelField(value = "创建时间", writeConverter = TimeConverter.class)
    private Date createTime;
    /**
     * 更新人id
     */
    @TableField("UPDATED_BY")
    @ExcelField("更新人id")
    private String updatedBy;
    /**
     * 更新时间
     */
    @TableField("UPDATED_TIME")
    @ExcelField(value = "修改时间", writeConverter = TimeConverter.class)
    private Date modifyTime;
    /**
     * 删除人id
     */
    @TableField("DELETED_BY")
    @ExcelField("删除人id")
    private String deletedBy;
    /**
     * 删除时间
     */
    @TableField("DELETED_TIME")
    @ExcelField(value = "删除时间", writeConverter = TimeConverter.class)
    private Date deletedTime;
    /**
     * 删除标记
     */
    @TableField("DELETED_FLG")
    @ExcelField("删除标记")
    private String deletedFlg;

    /**
     * 查询条件用
     */
    private transient String roleIds;

}
